//<script type="text/javascript" src="AJax/AJax.js"></script>

function randNumber()
{
	var xmlhttp;
	
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp = new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	xmlhttp.onreadystatechange =
	function()
	{	
		//	readyState == 0 Hasn't Started
		//	readyState == 1 Connected to Server
		//	readyState == 2 Server has recieved our request
		//	readyState == 3 Server Processing
		//	readyState == 4 Request is finished and data is ready
		
		if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
		{
			document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
		}
		else
		{
			document.getElementById("myDiv").innerHTML = "<string>Waiting for Server Response ...</string>";
		}
	}
	xmlhttp.open("POST", "AJax/AJaxRand.php", true);
	xmlhttp.send();
	
}

function showHint(str)
{
	if (str.length==0) { 
	    document.getElementById("txtHint").innerHTML="";
	    return;
	} 
	else 
	{
	    var xmlhttp = new XMLHttpRequest();
	    xmlhttp.onreadystatechange =
	    function() 
	    {
	        if (xmlhttp.readyState==4 && xmlhttp.status==200) 
	        {
	            document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
	        }
	    }
    xmlhttp.open("GET","AJax/Users.php?q="+str,true);
    xmlhttp.send();
	}    
}



function userDB(str)
{
	var xmlhttp;
	if (str=="")
	{
		document.getElementById("txtHint").innerHTML="";
		return;
	}
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			document.getElementById("userName").innerHTML=xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET","AJax/AJaxDBSERVER.php?name="+str,true);
	xmlhttp.send();
}